package com.woniuxy.commons.service;

import com.woniuxy.commons.dto.UserInfoDto;
import com.woniuxy.commons.interceptor.FeignOauth2RequestInterceptor;
import com.woniuxy.commons.request.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.List;

@FeignClient(name = "user", path = "/user", contextId = "user",configuration = FeignOauth2RequestInterceptor.class)
public interface FeignUserService {
    @GetMapping("/findPermsByToken/{token}")
    public ResponseResult<List<String>> findPermsByToken(@PathVariable("token") String token);

    @GetMapping("findById/{id}")
    public ResponseResult<UserInfoDto> findById(@PathVariable("id") Integer id);

    @PutMapping("/enableAccount/{id}")
    public ResponseResult<Boolean> enableAccount(@PathVariable("id") Integer id);

    @PutMapping("/disableAccount/{id}")
    public ResponseResult<Boolean> disableAccount(@PathVariable("id") Integer id);
}
